A = [x_const; x; x_quad]';  %构建超定方程组的系数矩阵
[Q,R] = qr(A);  %QR分解
R1 = R(1:3, :); %提取R的前3行

b = Q' * y';    %y'即为超定方程组的右端项  
b1 = b(1:3);    %提取b的前3行

x_ = R1 \ b1;   %解方程组

%作图
hold on  
fplot(@(x) x_(1) + x_(2)*x + x_(3)*x.^2, [x(1), x(end)], 'g');  
plot(x, y, 'ro');  
hold off 

%条件数
cond_G = cond(G, 2);
cond_R1 = cond(R1, 2);